﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ISmart;
using System.Text;

namespace Console.Controllers
{
    public class DefaultController : Controller
    {
        //
        // GET: /Default/

        public ActionResult Index()
        {
            GetUserList gul = new GetUserList("", "");
            StringBuilder str = new StringBuilder("<table border=\"1\"><tr><th>UID</th><th>UserName</th><th>RealName</th><th>Tel</th><th>Email</th><th>QQ</th><th>State</th></tr>");

            foreach (ISmart.Models.UserItem ui in gul.Items)
            {
                str.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td>{5}</td><td>{6}</td></tr>",
                    ui.UID,
                    ui.UserName,
                    ui.RealName,
                    ui.Tel,
                    ui.Email,
                    ui.QQ,
                    ui.State
                    );
            }
            str.Append("</table>");

            ViewData["test"] = str;

            return View();
        }

    }
}
